package com.tian.controller;

import com.tian.entity.User;
import com.tian.feign.TestFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author tianwc  公众号：java后端技术全栈、面试专栏
 * @version 1.0.0
 * @date 2023年05月09日 19:31
 * 博客地址：<a href="http://woaijava.cc/">博客地址</a>
 * <p>
 * 测试
 */
@Slf4j
@RestController
@RequestMapping("/admin/test")
public class TestController {

    @Resource
    private TestFeignClient testFeignClient;

    @GetMapping("/index/{id}")
    public User test(@PathVariable("id") Long id) {
        log.info("charge-web-接收到参数：id={}", id);
        return testFeignClient.test(id);
    }
}
